package cn.al2.util.demo;

import cn.al2.util.GenerateUtil;

import java.io.FileWriter;
import java.io.IOException;

public class FileWriterDemo {


    public static void main(String[] args) {
        String filePath = "FileWriterDemo.txt"; // 文件路径


        try (FileWriter writer = new FileWriter(filePath)) {

            long start = System.currentTimeMillis();

            for (String logStr : GenerateUtil.getInstance().staticProduct()) {
                writer.write(logStr);
            }
            long end = System.currentTimeMillis();

            System.out.println("fw 文件写入成功 耗时：" + (end - start));
        } catch (IOException e) {
            System.err.println("" + e.getMessage());
        }
    }
}


